/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author lomanda
 */
@Embeddable
public class ItemCompraPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "fkidCompra")
    private int fkidCompra;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fkidMaterial")
    private int fkidMaterial;

    public ItemCompraPK() {
    }

    public ItemCompraPK(int fkidCompra, int fkidMaterial) {
        this.fkidCompra = fkidCompra;
        this.fkidMaterial = fkidMaterial;
    }

    public int getFkidCompra() {
        return fkidCompra;
    }

    public void setFkidCompra(int fkidCompra) {
        this.fkidCompra = fkidCompra;
    }

    public int getFkidMaterial() {
        return fkidMaterial;
    }

    public void setFkidMaterial(int fkidMaterial) {
        this.fkidMaterial = fkidMaterial;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) fkidCompra;
        hash += (int) fkidMaterial;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItemCompraPK)) {
            return false;
        }
        ItemCompraPK other = (ItemCompraPK) object;
        if (this.fkidCompra != other.fkidCompra) {
            return false;
        }
        if (this.fkidMaterial != other.fkidMaterial) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.ItemCompraPK[ fkidCompra=" + fkidCompra + ", fkidMaterial=" + fkidMaterial + " ]";
    }
    
}
